package org.frogs.algo;


import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.StringTokenizer;

public class FrogPool {
	private int poolRadius;
	private Frog myFrog;
	private Frog enemyFrog;
	private int bulletNumber;
	private List<Bullet> bulletList;
	
	public FrogPool(Scanner input) {
		this.poolRadius = Integer.parseInt(input.nextLine());
		
		//myFrog
		StringTokenizer frogDetails = new StringTokenizer (input.nextLine());
		Double myFrogX = Double.parseDouble(frogDetails.nextToken());
		Double myFrogY = Double.parseDouble(frogDetails.nextToken());
		Integer reloadTime = Integer.parseInt(frogDetails.nextToken());
		this.myFrog = new Frog(myFrogX, myFrogY, reloadTime);
		
		//enemyFrog
		StringTokenizer enemyFrogDetails = new StringTokenizer (input.nextLine());
		Double enemyFrogX = Double.parseDouble(enemyFrogDetails.nextToken());
		Double enemyFrogY = Double.parseDouble(enemyFrogDetails.nextToken());
		Integer reloadTimeEnemy = Integer.parseInt(enemyFrogDetails.nextToken());
		this.enemyFrog = new Frog(enemyFrogX, enemyFrogY, reloadTimeEnemy);

		int bullets = Integer.parseInt(input.nextLine());
		this.bulletNumber = bullets;
		this.bulletList = new ArrayList<Bullet>();
		for (int i = 0; i < bullets; i++) {
			StringTokenizer bulletDetails = new StringTokenizer (input.nextLine());
			Double currBulletX = Double.parseDouble(bulletDetails.nextToken());
			Double currBulletY = Double.parseDouble(bulletDetails.nextToken());
			Double nextBulletX = Double.parseDouble(bulletDetails.nextToken());
			Double nextBulletY = Double.parseDouble(bulletDetails.nextToken());
			this.bulletList.add(new Bullet(currBulletX, currBulletY, nextBulletX, nextBulletY));
		}
	}
	
	public boolean isStartingPossition() {
		return poolRadius == 100;
	}
	
	//GET SET
	public Frog getEnemyFrog() {
		return enemyFrog;
	}
	public void setEnemyFrog(Frog frog) {
		this.enemyFrog = frog;
	}
	public int getPoolRadius() {
		return poolRadius;
	}
	public void setPoolRadius(int poolRadius) {
		this.poolRadius = poolRadius;
	}
	public Frog getMyFrog() {
		return myFrog;
	}
	public void setMyFrog(Frog frog) {
		this.myFrog = frog;
	}
	public int getBulletNumber() {
		return bulletNumber;
	}
	public void setBulletNumber(int bulletNumber) {
		this.bulletNumber = bulletNumber;
	}
	public List<Bullet> getBulletList() {
		return bulletList;
	}
	public void setBulletList(List<Bullet> bulletList) {
		this.bulletList = bulletList;
	}
}
